﻿using EOM.TSHotelManagement.Shared;
using System;

namespace EOM.TSHotelManagement.Common.Util
{
    public static class EmailTemplate
    {
        public static Template GetResetPasswordTemplate(string newPwd)
        {
            return new Template
            {
                Subject = LocalizationHelper.GetLocalizedString("Reset Password Notice", "重置密码通知"),
                Body = $@"<h5>{LocalizationHelper.GetLocalizedString("Dear User,", "尊敬的用户：")}</h5>
                            <p>{LocalizationHelper.GetLocalizedString(
                                $"Your password was reset at <strong>{DateTime.Now:yyyy/MM/dd HH:mm}</strong>. New password:",
                                $"您的密码已在<strong>{DateTime.Now:yyyy/MM/dd HH:mm}</strong>重置。新密码如下：")}
                            </p>
                            <p style='color: #666;'>{newPwd}</p>
                            <p>{LocalizationHelper.GetLocalizedString(
                                "Please keep your password secure and change it after login.",
                                "请妥善保管密码，并在成功登录后修改为你能记住的密码！")}</p>"
            };
        }

        public static Template GetNewRegistrationTemplate(string newPassword)
        {
            return new Template
            {
                Subject = LocalizationHelper.GetLocalizedString("New Registration Notification", "​新注册通知"),
                Body = $@"<h1>{LocalizationHelper.GetLocalizedString("Dear User,", "尊敬的用户：")}</h1>
                            <p>{LocalizationHelper.GetLocalizedString(
                                $"You have successfully registered to the system on {DateTime.Now:yyyy/MM/dd}. Your account credentials are as follows:​",
                                $"您已于<strong>{DateTime.Now:yyyy/MM/dd}</strong>新注册系统成功，账号密码如下：")}
                            </p>
                            <p style='color: #666;'>{newPassword}</p>
                            <p>{LocalizationHelper.GetLocalizedString(
                                "Please keep your password secure and change it after login.",
                                "请妥善保管密码，并在成功登录后修改为你能记住的密码！")}</p>"
            };
        }

        public static Template GetUpdatePasswordTemplate(string newPassword)
        {
            return new Template
            {
                Subject = LocalizationHelper.GetLocalizedString("Update Password Notification", "更新密码通知"),
                Body = $@"<h1>{LocalizationHelper.GetLocalizedString("Dear User,", "尊敬的用户：")}</h1>
                            <p>{LocalizationHelper.GetLocalizedString(
                                $"Your password was updated at {DateTime.Now:yyyy/MM/dd}. New password:",
                                $"您的密码已在<strong>{DateTime.Now:yyyy/MM/dd}</strong>更新。新密码如下：")}
                            </p>
                            <p style='color: #666;'>{newPassword}</p>
                            <p>{LocalizationHelper.GetLocalizedString(
                                "Please keep your password secure and change it after login.",
                                "请妥善保管密码！")}</p>"
            };
        }
    }
}
